package com.example.common.generator;

import com.example.admin.entity.GenTable;
import com.example.common.config.DbConfig;
import com.example.common.config.GenerConfig;
import com.example.common.generator.entity.GeneratorInfo;

public abstract class AbstractFastCodingGenerator {

    /**
     * 生成信息
     */
    protected GenerConfig generConfig;
    protected DbConfig dataSource;
    protected GeneratorInfo generatorInfo;
    protected GenTable genTable;



    /**
     * 初始化配置
     */
    public void init(GenerConfig generConfig, DbConfig dataSource, GeneratorInfo generatorInfo) {
        this.generConfig = generConfig;
        this.dataSource = dataSource;
        this.generatorInfo = generatorInfo;
    }
    public void init(GenerConfig generConfig, DbConfig dataSource, GeneratorInfo generatorInfo, GenTable genTable) {
        this.generConfig = generConfig;
        this.dataSource = dataSource;
        this.generatorInfo = generatorInfo;
        this.genTable=genTable;
    }

    /**
     * 执行生成
     *
     * @return 临时路径
     * @throws Exception
     */
    public abstract void execute() throws Exception;


    public void setGenTable(GenTable genTable) {
        this.genTable = genTable;
    }
}